#!/usr/bin/python
import urllib2
import urllib
def main():
	parameters = {"action" : "cp"}
	url="http://lak-shay.appspot.com/admin/datastore"
	models = ["models.Log","models.Mutex","models.Transactions","models.OCCTrans","models.OCCLog","models.OCCOperations","models.Operations","models.DataItems","models.GeneralCounterShard","models.Locks","models.GeneralCounterShardConfig"]
	for model in models:
		parameters ["model"]=model
		success = False
		while not success:
			try:
				req = urllib2.Request(url,data=urllib.urlencode(parameters))
				resp=urllib2.urlopen(req)
				r = resp.read()
				success = True
			except:
				print "Failed for model %s. Trying again" % model
			

if __name__ == "__main__":
	main()
